package com.aaa.cart.controller;

import com.aaa.cart.service.CartService;
import com.aaa.entity.OmsCartItem;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * fileName:CartController
 * description:
 * author:MT
 * createTime:2020/2/20 18:09
 * version:1.0.0
 */
@RestController
@RequestMapping("cartItem")
public class CartController {
    @Autowired
    private CartService cartService;

    @RequestMapping("add")
    public Object addProductToCart(@RequestParam Map map){
        return cartService.addToCart(map);
    }

    @RequestMapping("minus")
    public Object minusProductToCart(@RequestParam Map map){
        return cartService.minusToCart(map);
    }


    @RequestMapping("list")
    public Object listCartItem(@RequestParam Map map){
        return cartService.queryCartItem(map);
    }

    @RequestMapping("delete")
    public Object deleteCartItemById(@RequestParam Map map){
        return cartService.deleteCartItemById(map);
    }
}
